//用户相关接口
import request from '@/utils/request';
import type { loginForm, loginResponseData, userResponseData } from './type';
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}

// 用户登录接口
export function reqLogin(data: loginForm) {
  return request<any, loginResponseData>({
    url: API.LOGIN_URL,
    method: 'post',
    data,
    isAuth: true,
  });
}

//获取用户信息接口
export function reqUserInfo() {
  return request<any, userResponseData>({
    url: API.USERINFO_URL,
    method: 'get',
  });
}

//获取用户信息接口
export function reqLogout() {
  return request<any, any>({
    url: API.LOGOUT_URL,
    method: 'get',
  });
}
